function fnShowEstimateReport(estimateid, width, height) {
	var url = "/RS/SBM/Reports/RSEstimateReport.aspx?estimateid=" + estimateid;
	var fullurl = fnGetDomain() + url;
	var style = "width=" + width + ",height=" + height;
	style = style + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes";
	window.open(fullurl, "EstimateReport", style);
}
function fnShowInvoiceReport(workorderid, invoiceid, width, height) {
	var url = "/RS/SBM/Reports/RSInvoiceReport.aspx?workorderid=" + workorderid + "&invoiceid=" + invoiceid;
	var fullurl = fnGetDomain() + url;
	var style = "width=" + width + ",height=" + height;
	style = style + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes";
	window.open(fullurl, "InvoiceReport", style);
}
function fnLaunchWin(url, title, width, height) {
    var fullurl = fnGetDomain() + "/" + url;
    alert(fullurl);
	var style = "width=" + width + ",height=" + height;
	style = style + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes";
	window.open(fullurl, title, style);
}
function fnLaunchModalDialog(url, title, width, height) {
	var fullurl = fnGetDomain() + url;
	var style = "width=" + width + ",height=" + height;
	style = style + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes";
	window.showModalDialog(fullurl, title, style);
}
function fnGetDomain() {
	var url = window.location.href;
	var arr = url.split("/");
	var domain = arr[0] + "//" + arr[2];
	return domain;
}
